logo

Notes and Conventions

Notes

  • This is an example R Markdown report to demonstrate the workflow for building a “data memo” or report object in parallel with the conduct of a RsNLME analysis.
  • We use html output and “tabsets” within the RMarkdown document to show how RsNLME can be used together with R markdown to produce very dense, interactive data summaries that capture a large amount of data in well organized, easily shared delivery mechanism.

Conventions used in this document

  • We’ve used blue text boxes to indicate descriptive information
  • We’ve used yellow text boxes to indicate results
  • Green text boxes provide key messages from the analysis results
  • Example: This is a key message statement
# Analysis ID     : Certara.R School Lesson 4 - Modeling with RsNLME
# Purpose         : Introduce R Markdown 
# Other Info      : 
library(flextable)
library(plotly)

Objectives

The purpose of this data memo is to provide a summary of the base population pharmacokinetic model fit for study XYZ

Study Design

  • 150 healthy male and female subjects were enrolled in this study
  • Subjects were administered a single 5000, 10000, or 20000 ug dose of Drug XYZ at time=0
  • Blood samples were obtained at 0, 0.25, 0.5, 1, 2, 3, 4, 6, 8, 12, 16 and 24 hours after dosing
  • Covariates in the dataset include baseline subject age, weight, sex, and race

Methods

Overview of the data

Summary

  • Elimination profile appears to be mono-exponential
  • Body weight and/or gender appear to influence PK



Demography summary

dm_table <- readRDS(file='dmtable.RDS')
dm_table
Characteristic N = 1501
AGE 50.5 (38.0 - 61.0)
WT 71 (55 - 94)
SEX
F 45 (30%)
M 105 (70%)
RACE
ASIAN 21 (14%)
BLACK 36 (24%)
OTHER 33 (22%)
WHITE 60 (40%)

1 Mean (Range); n (%)



Mean Concentration Summary

mean_conc_table <- readRDS(file='mean_conc_table.RDS')
mean_conc_table



PK profiles Linear

pkplot <- readRDS(file='pkplot.RDS')

ggplotly(pkplot)



PK profiles Log

  • Disposition appears mono-exponential
pkplotlog <- readRDS(file='pkplotlog.RDS')
pkplotlog



Facet Gender and Dose Linear

  • Possible gender difference in PK with observed concentrations higher in females
pkplot_dosesex <- readRDS(file='pkplot_dosesex.RDS')
pkplot_dosesex



Facet Race and Dose Linear

  • PK appears similar across race
pkplot_doserace <- readRDS(file='pkplot_doserace.RDS')
pkplot_doserace



Facet WT Linear

  • PK appears similar across WT groups
pkplot_dosewt <- readRDS(file='pkplot_dosewt.RDS')
pkplot_dosewt



Facet Age Linear

  • PK appears similar across age groups. Note limited age range (38 to 61 y).
pkplot_doseage <- readRDS(file='pkplot_doseage.RDS')
pkplot_doseage

Base Model Development

Summary

  • A 1 compartment model with first order oral input and elimination was used to fit the data
  • Convergence was achieved with successful estimation of parameter standard errors



Model Description

  • A 1 compartment model with first order oral input and elimination was used to fit the data
  • Model parameters absorption rate constant (Ka), central clearance (Cl), and central volume (V)
  • Between subject variability terms on Ka, Cl and V
  • Additive residual error model

Structural PK Model

## View the updated model 
basemod<-readRDS("basemod.RDS")
print(basemod)
## Loading required package: Certara.RsNLME
## 
##  Model Overview 
##  ------------------------------------------- 
## Is population     :  TRUE
## Model Type        :  PK
## 
##  PK 
##  ------------------------------------------- 
## Parameterization  :  Clearance
## Absorption        :  FirstOrder
## Num Compartments  :  1
## Dose Tlag?        :  FALSE
## Elimination Comp ?:  FALSE
## Infusion Allowed ?:  FALSE
## Sequential        :  FALSE
## Freeze PK         :  FALSE
## 
##  PML 
##  ------------------------------------------- 
## test(){
##     cfMicro(A1,Cl/V, first = (Aa = Ka))
##     dosepoint(Aa)
##     C = A1 / V
##     error(CEps=5)
##     observe(CObs=C + CEps)
##     stparm(Ka = tvKa * exp(nKa))
##     stparm(V = tvV * exp(nV))
##     stparm(Cl = tvCl * exp(nCl))
##     fcovariate(AGE)
##     fcovariate(WT)
##     fcovariate(SEX())
##     fcovariate(RACE())
##     fcovariate(DOSEGRP)
##     fixef( tvKa = c(,1.5,))
##     fixef( tvV = c(,80,))
##     fixef( tvCl = c(,9,))
##     ranef(diag(nKa,nV,nCl) = c(0.1,0.1,0.1))
## }
## 
##  Structural Parameters 
##  ------------------------------------------- 
##  Ka V Cl
##  ------------------------------------------- 
## Observations:
## Observation Name :  CObs
## Effect Name      :  C
## Epsilon Name     :  CEps
## Epsilon Type     :  Additive
## Epsilon frozen   :  FALSE
## is BQL           :  FALSE
##  ------------------------------------------- 
##  Column Mappings 
##  ------------------------------------------- 
## Model Variable Name : Data Column name
## id                  : ID
## time                : TIME
## Aa                  : AMT
## AGE                 : AGE
## WT                  : WT
## SEX                 : SEX( M=0 F=1 )
## RACE                : RACE( WHITE=0 BLACK=1 ASIAN=2 OTHER=3 )
## DOSEGRP             : DOSEGRP
## CObs                : CONC

Model Fit Summary

  • Convergence was achieved with successful estimation of parameter standard errors
## View the updated model 
basemodfit<-readRDS("basemodfit.RDS")
print(basemodfit)
## $Overall
##    Scenario RetCode    LogLik     -2LL      AIC      BIC nParm nObs nSub
## 1: WorkFlow       1 -7187.912 14375.82 14389.82 14427.68     7 1650  150
##    EpsShrinkage Condition
## 1:      0.10699  73.06982
## 
## $theta
##    #Scenario Parameter  Estimate Units     Stderr      CV%    2.5%CI   97.5%CI
## 1:  WorkFlow      tvKa  1.195375    NA 0.03937092 3.293605  1.118152  1.272597
## 2:  WorkFlow       tvV 80.425584    NA 2.83247767 3.521861 74.869937 85.981231
## 3:  WorkFlow      tvCl  7.731636    NA 0.42486324 5.495127  6.898305  8.564967
## 4:  WorkFlow      CEps 13.789523    NA 0.77473096 5.618258 12.269959 15.309088
##    Var.Inf.factor
## 1:             NA
## 2:             NA
## 3:             NA
## 4:             NA
## 
## $omega
##    Label        nKa        nV       nCl
## 1:   nKa 0.07185426 0.0000000 0.0000000
## 2:    nV 0.00000000 0.1687598 0.0000000
## 3:   nCl 0.00000000 0.0000000 0.3953833
## 
## $omega_Correlation
##    Label nKa nV nCl
## 1:   nKa   1  0   0
## 2:    nV   0  1   0
## 3:   nCl   0  0   1
## 
## $Eta_Shrinkage
##        Label       nKa         nV        nCl
## 1: Shrinkage 0.3216746 0.05676357 0.06095907
## 
## $omega_stderr
##    Label        nKa         nV        nCl
## 1:   nKa 0.01546955 0.00000000 0.00000000
## 2:    nV 0.00000000 0.02327878 0.00000000
## 3:   nCl 0.00000000 0.00000000 0.04707696

Session Info

sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Certara.RsNLME_1.1.0 plotly_4.10.0        ggplot2_3.3.5       
[4] flextable_0.6.10    

loaded via a namespace (and not attached):
 [1] httr_1.4.2          sass_0.4.0          tidyr_1.2.0        
 [4] jsonlite_1.8.0      viridisLite_0.4.0   bslib_0.3.1        
 [7] shiny_1.7.1         assertthat_0.2.1    highr_0.9          
[10] yaml_2.3.5          equatags_0.1.1      gdtools_0.2.3      
[13] shinymaterial_1.2.0 locatexec_0.1.1     pillar_1.7.0       
[16] backports_1.4.0     glue_1.6.2          uuid_1.0-3         
[19] digest_0.6.29       polyclip_1.10-0     promises_1.2.0.1   
[22] checkmate_2.0.0     colorspace_2.0-3    htmltools_0.5.2    
[25] httpuv_1.6.3        pkgconfig_2.0.3     purrr_0.3.4        
[28] xtable_1.8-4        scales_1.2.0        xslt_1.4.3         
[31] tweenr_1.0.2        later_1.3.0         officer_0.4.1      
[34] ggforce_0.3.3       tibble_3.1.6        generics_0.1.2     
[37] farver_2.1.0        ellipsis_0.3.2      gtsummary_1.5.0    
[40] withr_2.5.0         shinyjs_2.1.0       lazyeval_0.2.2     
[43] cli_3.2.0           magrittr_2.0.3      crayon_1.5.1       
[46] mime_0.12           evaluate_0.15       fansi_1.0.3        
[49] MASS_7.3-54         broom.helpers_1.4.0 xml2_1.3.3         
[52] tools_4.1.2         data.table_1.14.2   lifecycle_1.0.1    
[55] stringr_1.4.0       munsell_0.5.0       zip_2.2.0          
[58] Certara.NLME8_1.2.0 compiler_4.1.2      jquerylib_0.1.4    
[61] systemfonts_1.0.3   rlang_1.0.2         grid_4.1.2         
[64] gt_0.3.1            rstudioapi_0.13     htmlwidgets_1.5.4  
[67] crosstalk_1.2.0     base64enc_0.1-3     labeling_0.4.2     
[70] rmarkdown_2.11      gtable_0.3.0        DBI_1.1.1          
[73] R6_2.5.1            knitr_1.38          dplyr_1.0.8        
[76] fastmap_1.1.0       utf8_1.2.2          commonmark_1.7     
[79] stringi_1.7.6       Rcpp_1.0.8.3        vctrs_0.4.1        
[82] tidyselect_1.1.2    xfun_0.30